<?php
use common\service\StaticService;
use backend\assets\AdminAsset;
use common\service\GlobalUrlService;

StaticService::includeAppCssStatic(GlobalUrlService::buildStaticUrl('/css/supplier/add.css'),AdminAsset::class);
StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/backend/qiniu.min.js'),AdminAsset::class);
StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/backend/supplier/add.js'),AdminAsset::class);
?>
<div class="content_box">
  <div class="add_goods">
    <form class="layui-form">
      <ul class="form_ul">
        <li>
          <span class="title">商品分类</span>
          <div class="layui-inline">
            <div class="layui-input-inline">
              <select lay-verify="required" class="span2 oneclass" name="tree_id" lay-filter="one">
                <option value="0">请选择主营类目</option>
                  <?php foreach ($trees as $val):?>
                    <option value="<?=$val['id']?>"><?=$val['tree_name']?></option>
                  <?php endforeach;?>
              </select>
            </div>
            <div class="layui-input-inline">
              <select lay-verify="required" class="span2 twoclass" name="tree_id" lay-filter="two"></select>
            </div>
            <div class="layui-input-inline">
                  <select class="threeclass" name="three_id">
                  </select>
            </div>
          </div>
        </li>
        <li>
          <span class="title" class="layui-inline">商品名称</span>
          <div class="item">
            <input type="text" class="layui-input layui-input-inline menu-name" name="goods_name" />
            <span class="menu_name_count">0</span>/45
          </div>
        </li>
        <li>
          <span class="title" class="layui-inline">商品类别</span>
          <div class="item">
            <input type="radio" title="商城" value="0" name="goods_type" checked/>
            <input type="radio" title="推荐" value="2" name="goods_type"/>
            <input type="radio" title="热门" value="3" name="goods_type"/>
            <input type="radio" title="新品" value="4" name="goods_type"/>
            <input type="radio" title="折扣" value="5" name="goods_type"/>
          </div>
        </li>
        <li class="edit_cover">
          <span class="title">封面图</span>
          <div class="layui-inline">
            <label class="upload_cover" for="pic-card3">
              <span class="layui-btn" >
                <i class="layui-icon">&#xe67c;</i>上传封面图
              </span>
            </label>
            <input type="file" class="pic-card3" id="pic-card3">
            <input type="hidden" name="list_img" value="" class="hidden-pic3">
            <img src="" class="pic3" />
          </div>

        </li>
        <li>
          <span class="title">商品规格</span>
          <div class="item">
            <div class="controls">
              <div class="size-warpper">
                <span class="layui-btn layui-inline add-attr" style="font-size: 25px;font-weight: bold;">+</span>
              </div>
              <div class="hide add-attr-warpper">
                <div class="control-group layer-attr-tit">
                  <label class="layui-inline">规格名称:</label>
                  <div class="controls layui-inline">
                    <input type="text" id="attr_name" name="attr_name" class="layui-input" placeholder="请输入规格名称">
                  </div>
                </div>
                <div class="text-align-center">
                  <div>
                    <button type="button" class="layui-btn do">提交</button>
                    <button type="button" class="layui-btn layui-btn-primary cancel">取消</button>
                  </div>
                </div>
              </div>

              <div class="layui-tab" style="display: none;">
                <ul class="layui-tab-title attribute-name">
                </ul>
                <div class="layui-tab-content attribute-value"></div>
              </div>
              <button class="layui-btn display" type="button">生成属性</button>

              <div class="tab-content end-table">
                <table class="layui-table">
                  <thead class="thead">
                    <tr style="background-image: -webkit-linear-gradient(top, #ffffff 0%, #f2f2f2 100%)">
                      <th class="width100">原价</th>
                      <th class="width100">折扣价</th>
                      <th class="width100">库存</th>
                      <th class="width100">图片</th>
                    </tr>
                  </thead>
                  <tbody class="tbody">
                    <tr>
                      <td><input class="layui-input need" type="number" name="original_price" placeholder="0.00" min="0"></td>
                      <td><input class="layui-input need" type="number" name="discount_price" placeholder="0.00" min="0"></td>
                      <td><input class="layui-input need" type="number" placeholder="0" name="inventory" min="0"></td>
                      <td width="160px;"><input class="pic-card pic-card4" type="file" indexs="1"><input type="hidden" name="attrimgval" value="" class="attrimgvalue need  attrList imgindex+(i+1)"></td>
                      <td style="display: none;"><input value="0-0-0" class="need"/></td>
                    </tr>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
        </li>
        <li>
          <span class="title">属性描述</span>
          <div class="item">
            <dl>
              <dt>
                <span class="layui-btn add_attr_describe">添加属性描述</span>
              </dt>
              <dd class="attr_describe">
                <div>
                  <span>
                    <input type="text" name="key" class="layui-input" placeholder="属性" />
                    <input type="text" name="val" class="layui-input" placeholder="描述" />
                  </span>
                  <b class="layui-btn del_attr_describe">删除</b>
                </div>
              </dd>
            </dl>
          </div>
        </li>
        <li class="yf">
          <span class="title">运费</span>
          <div class="item"><span>统一运费 <input type="text" class="layui-input layui-input-inline" name='freight' /></span></div>
        </li>
        <li>
          <span class="title">商品描述</span>
          <div class="item">
            <textarea name="desc" placeholder="请输入内容" class="layui-textarea" id="introduction"></textarea>
            <p style="text-align: right;"><span class="introduction_count">0</span>/220</p>
          </div>
        </li>
        <li>
          <span class="title">详情图</span>
          <div class="item">
            <div class="show-pic" style="width: 100px;">
              <span class="btn btn-file" style="display: none;">
                  <span class="fileupload-new">请选择图片</span>
                        <input type="file" class="default" id="choosepic">
                        <input type="hidden" name="list_img" value="" class="hidden-pic">
                      </span>
                <label for="choosepic"><span class="layui-btn"><i class="layui-icon">&#xe67c;</i>上传图片详情图</span></label>
                <input type="hidden" name="list_img" value="" class="hidden-pic">
            </div>
            <div class="imgs" style="margin-top: 20px;">
              <span>
                <img src="" />
              </span>
            </div>
          </div>
        </li>
      </ul>
    </form>
    <div class="btns">
      <button class="layui-btn btn-last-googs" id="qued">确定</button>
      <a class="layui-btn layui-btn-primary" onclick="window.history.go(-1);">取消</a>
    </div>
  </div>
</div>